#region Summary

// 
// Owner : JackieHan 
// 
// Solution : DailyCollection 
// 
// Project : Jackie.Utility.Notify.Domain
// 
// File : MessageHistoryInfo.cs
// 
// CopyRight : Copyright © 2010-2011 Skomart Corporation, All Rights Reserved 
// 
// Summary : 消息历史信息
// 
// History : 
//			2011-04-28 15:02:23	    Create 
// 

#endregion

#region Using

using System;
using System.Collections.Generic;
using Jackie.Utility.Notify.Domain;

#endregion

namespace Jackie.Utility.Notify.Services.Manager
{
    /// <summary> 
    /// 消息历史信息
    /// </summary>
    public class MessageHistoryInfo
    {
        public MessageHistoryInfo()
        {
            SendedHistory = new List<MessageSendInfo>();
        }

        /// <summary>
        /// 消息
        /// </summary>
        public MessageInfo Message { get; set; }

        /// <summary>
        /// 收到的时间
        /// </summary>
        public DateTime ReceivedTime { get; set; }

        /// <summary>
        /// 发往各客户端信息记录
        /// </summary>
        public List<MessageSendInfo> SendedHistory { get; set; }

        /// <summary>
        /// 是否已经发往某个客户端
        /// </summary>
        /// <param name="client">客户端</param>
        /// <returns></returns>
        public bool IsSend(ClientSubscribeInfo client)
        {
            return SendedHistory.Exists(item => item.SendedClient.ClientSign.Equals(client.ClientSign));
        }
    }
}